package com.palm.core.translator;

import java.util.Map;

public class SimpleTranslator implements Translator {
    final private Map<Object,Object> valueMapping;
    public SimpleTranslator(Map<Object,Object> mapping){
        this.valueMapping=mapping;
    }
    @Override
    public Object translate(Object target,String filedName,Object value){
        if(value==null){
            return null;
        }
        return valueMapping.get(value);
    }
}
